﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using HRM.DAL.DAO;
using HRM.DAL.Gateway;

namespace HRM.BLL
{
    public class DesignationManager
    {
        DesignationGateway gateway =new DesignationGateway();
        
        //Saving Designation
        public bool Save(Designation designation)
        {
            if (gateway.HasThisDesignationAlreadyExists(designation))
            {
                return false;
            }
            else
            {
                return gateway.Save(designation);
            }
        }

        //Editing Designation
        public bool Edit(Designation designation)
        {
            return gateway.Edit(designation);
        }

        // Deleting Designation

        public bool Delet(Designation designation)
        {
            return gateway.Delete(designation);
        }

        // Get All Designation

        public List<Designation> GetAllDesignations()
        {
            return gateway.GetAllDesignations();
        }

        public int GetDesignationId(Designation designation)
        {
            return gateway.GetDesignationId(designation);
        }
    }
}